package com.vip.pathbootstarter.anon;

import com.fasterxml.jackson.databind.introspect.Annotated;
import com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector;

public class PathFieldAnnotationIntrospect extends NopAnnotationIntrospector {

    @Override
    public Object findSerializer(Annotated am) {
        PathField annotation = am.getAnnotation(PathField.class);
        if (annotation != null) {
            return PathFieldSerializer.class;
        }
        return super.findSerializer(am);
    }

    @Override
    public Object findDeserializer(Annotated am) {
        PathField annotation = am.getAnnotation(PathField.class);
        if (annotation != null) {
            return PathFieldDeserializer.class;
        }
        return super.findDeserializer(am);
    }

}
